home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / cstrings.arc / STRINS.C < prev    next >
Text File  |  1985-08-06  |  2KB  |  86 lines

  1. /*
  2.     CSTRINGS.LBR VERSION 1.0
  3.     Spark Software, Inc.
  4.  
  5.         If you find this software of use, it is requested that you send
  6.         a donation ($10.00 suggested) to:
  7.  
  8.             Spark Software, Inc.
  9.             24 Royal Crest Dr., #5
  10.             Nashua, NH  03060
  11.  
  12.         Upon receiving your donation, your name will be added to the 
  13.         List of Registered Users, and future updates can be obtained
  14.         from the SPARKIE RBBS at (603) 888-8179.
  15.  
  16.         If you include an extra $10.00 with your donation, the newest
  17.         version of CSTRINGS.LBR will be mailed to you.
  18.  
  19.         Call SPARKIE RBBS at the number above for other Spark Software
  20.         products!!!
  21. */
  22.  
  23. /*
  24.  * stri (s, c, n1, n)
  25.  * char *s;
  26.  * char c;
  27.  * int n1, n;
  28.  *
  29.  * This function inserts character c at all positions in s from postion n1
  30.  * to position n.
  31.  */
  32.  
  33. stri (s, c, n1, n)
  34. char *s;
  35. char c;
  36. int n1, n;
  37. {
  38.     int i;
  39.        
  40.     for (i = n1; i <= n; i++)
  41.          s[i] = c;
  42. } /* stri */
  43.  
  44. /*
  45.  *    strilf (s, c, n)
  46.  * char *s;
  47.  * char c;
  48.  * int n;
  49.  *
  50.  * This function inserts character c at all postions in string s from the
  51.  * beginning of s to position n.
  52.  */
  53.  
  54. strilf (s, c, n)
  55. char *s;
  56. char c;
  57. int n;
  58. {
  59.     int i;
  60.      
  61.     for (i = 0; i <= n; i++)
  62.          s[i] = c;
  63. } /* strilf */
  64.  
  65. /*
  66.  *    strirt (s, c, n)
  67.  * char *s;
  68.  * char c;
  69.  * int n;
  70.  *
  71.  * This function inserts character c at all positions in string s from
  72.  * position n to the end of the string.
  73.  */
  74.  
  75. strirt (s, c, n)
  76. char *s;
  77. char c;
  78. int n;
  79. {
  80.     char *t;
  81.      
  82.     t = &s[n];
  83.     while (*t != '\0')
  84.          *t++ = c;
  85. } /* strirt */
  86.